<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head lang="en">
    <meta charset="UTF-8" />
    <title></title>
</head>
<body>
<h1 th:text="${host}">Hello World</h1>

<form th:action="@{/postUser}" th:object="${user}" method="post" th:method="post">

    <input type="text" th:field="*{userName}"/>
    <input type="text" th:field="*{age}"/>

    <input type="submit"/>
</form>


//用 th:remove 移除除了第一个外的静态数据，用第一个tr标签进行循环迭代显示
<tbody th:remove="all-but-first">
//将后台传出的 userList 的集合进行迭代，用user参数接收，通过user访问属性值
<tr th:each="user:${userList}">
    //用count进行统计，有顺序的显示
    <td th:text="${productStat.count}">1</td>
    <td th:text="${user.userName}">Red Chair</td>
    <td th:text="${'$' + #numbers.formatDecimal(product.price, 1, 2)}">$123</td>
    <td th:text="${#dates.format(product.availableFrom, 'yyyy-MM-dd')}">2014-12-01</td>
</tr>
<tr>
    <td>White table</td>
    <td>$200</td>
    <td>15-Jul-2013</td>
</tr>
<tr>
    <td>Reb table</td>
    <td>$200</td>
    <td>15-Jul-2013</td>
</tr>
<tr>
    <td>Blue table</td>
    <td>$200</td>
    <td>15-Jul-2013</td>
</tr>
</tbody>

</body>
</html>